﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;

namespace Autoverwaltung.Datenhaltung
{
    public struct Helper
    {
        public static Color HexToColor(string hex)
        {
            try
            {
                return ColorTranslator.FromHtml("#" + hex.TrimStart(new char[] { '#' }));
            }
            catch { }

            return Color.Black;
        }

        public static decimal StringToDecimal(string value)
        {
            decimal number = decimal.Zero;
            decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out number);
            return number;
        }
    }
}
